--[[
 -- *名称:main
 -- *描述:文件开始类
 -- *版权:Copyright © 2016-2018 深圳市三只小熊科技有限公司 版权所有
 -- *作者:Administrator
 -- *创建日期:2017-11-07
 -- *修改日期:2017-11-07
 -- @return [description]
 ]]
basePath = ""
require("json")
require(basePath.. "util/dump");
PokerGameConstant = require(basePath.. "constant/pokergameconstant");
require(basePath.."pokercore/functions");
pokercore = require(basePath.. "pokercore/object");
CardShape = require(basePath.. "domain/cardshape");
DdzCardType = require(basePath.. "domain/ddzcardtype");
DdzCardTypes = require(basePath.. "domain/ddzcardtypes");
PokerUtil =  require(basePath.."util/pokerutil");
DdzTypeUtil = require(basePath.."util/ddztypeutil");
ServerInterface = require(basePath.."pokerailogic_server");

--require(basePath .. "test");
local str = "{\"cmd\":\"compare\",\"cardarray\":[{\"cardList\":[{\"shape\":0,\"value\":0,\"number\":3}],\"cardtype\":1},{\"cardList\":[{\"shape\":0,\"value\":0,\"number\":4}],\"cardtype\":1}]}";

--全局方法
function invoker(str)
   local msg = json.decode(str) ; --解析数据
   if msg.cmd  == "compare" then
   	  return json.encode(ServerInterface.compare(msg));
   end
end
--print(invoker(str));